home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-11-19 | 1.8 KB | 97 lines | [TEXT/MPS ] |
- /*
- File: MiscTests.cp
-
- Contains: Miscellaneous tests
-
- Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #ifndef __GLOBALNEW__
- #include <GlobalNew.h>
- #endif
- #ifndef __MISCTESTS__
- #include "MiscTests.h"
- #endif
-
- //
- // Declare a TNoVTable static object so we can test having a static object
- // in the same library as the static objects implementation
- //
- static TNoVTable gTestStatic(9);
-
- /*******************************************************************************
- ** CLASS TNoVTable
- ********************************************************************************/
-
- TNoVTable::TNoVTable(long value)
- {
- fValue = value;
- }
-
- TNoVTable::~TNoVTable()
- {
- }
-
- long TNoVTable::Add(long value)
- {
- gTestStatic.Sub(0); // we need to generate a reference to gTestStatic somewhere
- return (fValue += value);
- }
-
- long TNoVTable::Sub(long value)
- {
- return (fValue -= value);
- }
-
- /*******************************************************************************
- ** CLASS TStdVTable
- ********************************************************************************/
-
- TStdVTable::TStdVTable(long value)
- {
- fValue = value;
- }
-
- TStdVTable::~TStdVTable()
- {
- }
-
- long TStdVTable::Add(long value)
- {
- return (fValue += value);
- }
-
- long TStdVTable::Sub(long value)
- {
- return (fValue -= value);
- }
-
- /*******************************************************************************
- ** CLASS TTimings
- ********************************************************************************/
-
- TTimings::TTimings()
- {}
-
- TTimings::~TTimings()
- {}
-
- void TTimings::VirtualFunc()
- {}
-
- void TTimings::Method()
- {}
-
- void TTimings::StaticFunc(void*)
- {}
-
- /*******************************************************************************
- ** ThrowException
- ********************************************************************************/
-
- void ThrowException(long value)
- {
- Fail(value);
- }
-